package com.chenxin.springcloud.controller;


import com.chenxin.springcloud.entity.User;
import com.chenxin.springcloud.service.UserService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class UserController {

    @Reference
    private UserService userService;


    @GetMapping("/getUsers")
    public List<User> getUsers(){
        List<User> users = userService.getUsers();
        return users;
    }

    @GetMapping("/hello")
    public String hello(){

        return userService.sayHello();
    }

}
